<?php namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Services\Articel as sArticel;
use Illuminate\Http\Request;

class ArticelController extends BaseController {

	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */

	public function index()
	{	
		$navs = $this->navs;

		$categories = $this->categories;
		
		$banners = $this->banners;
		
		$recommends = $this->recommends;

		$category_id = $_REQUEST['id'];

		$articels = sArticel::getArticelByCategoryID($category_id);

		return $this->view('articel',compact('navs','categories','banners','recommends','articels','category_id'));
	}

	/**
	 * Show the form for creating a new resource.
	 *
	 * @return Response
	 */
	public function create()
	{
		//
	}

	/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
		//
	}

	/**
	 * Display the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		$navs = $this->navs;

		$categories = $this->categories;
		
		$banners = $this->banners;
		
		$recommends = $this->recommends;

		// $category_id = $_REQUEST['id'];

		$articel = sArticel::getArticelDetail($id);

		return $this->view('detail',compact('navs','categories','banners','recommends','articel','category_id'));
	}

	/**
	 * Show the form for editing the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
		//
	}

	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
		//
	}

	/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
		//
	}

}
